﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BBPA.Admin.SYS.PAFee
{
    public partial class List : ListPage
    {
        BLL.V_PAFee bllList = new BLL.V_PAFee();
        BLL.PAFee bll = new BLL.PAFee();
        protected int StoreID = 0, SupplierID = 0;
        protected void Page_Load(object sender, EventArgs e)
        {
            StoreID = Security.GetCurrentStoreID();
            if (StoreID==0) StoreID = DataTypePlus.requestInt(Request.QueryString["StoreID"]);
            SupplierID = Security.GetCurrentSupplierID();
            if (SupplierID==0) SupplierID = DataTypePlus.requestInt(Request.QueryString["SupplierID"]);


            Master.show_btn_add = Master.show_btn_bat_del = Master.show_checkbox = Master.show_edit = Master.show_info = false;
            btn_PAFee.Visible = ((StoreID > 0 || SupplierID > 0) && Security.InUserType(new List<EnumHelper.UserType>() { EnumHelper.UserType.Administrator, EnumHelper.UserType.Accountant }));
            
            if (StoreID > 0) Master.BasicSQL = StringPlus.SQLand(Master.BasicSQL, "StoreID=" + StoreID);
            if (SupplierID > 0) Master.BasicSQL = StringPlus.SQLand(Master.BasicSQL, "SupplierID=" + SupplierID);
            Master.QueryString = "StoreID=" + StoreID + "&SupplierID=" + SupplierID;
        }
        public override void buildSQL_Page_List_search()
        {
        }
        public override DataSet get_Page_DataSet(string sql_, string orderby_, int pageFrom_, int pageTo_) { return bllList.GetListByPage(sql_, orderby_, pageFrom_, pageTo_); }
    }
}